Skip to content

fix: repair cross-package bugs to make all tests pass - #97

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2465-1785115269
Open

fix: repair cross-package bugs to make all tests pass#97
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2465-1785115269

Conversation

@stooit

@stooit stooit commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all four cross-package bugs so bun run test is fully green (13 pass, 0 fail). Each fix targets a documented bug with a covering test; no test files, dependencies, or unrelated code were touched.

Changes

  • apps/web/src/lib/api.ts — The useThrottle hook in @e2e/utils was renamed to useDebounce, but the app still imported the old name. Updated the import and re-export (export { useDebounce as useSearchDebounce }). The public useSearchDebounce name is unchanged, satisfying the export test.
  • packages/ui/src/components/Button/Button.tsx — An icon-only button had no accessible name (WCAG 4.1.2). Forwarded aria-label so the icon-only button exposes an accessible name.
  • packages/ui/src/components/DataTable/DataTable.tsx — The sort-direction toggle captured sortDir in a stale closure. Switched to the functional updater form setSortDir(prev => prev === "asc" ? "desc" : "asc"), fixing the controlled re-render test.
  • packages/utils/src/format/date.tsformatDate used the wrong locale/format string. Corrected it to produce the format the test expects.

Verification

  • bun run test13 pass, 0 fail across 5 files.
  • ./node_modules/.bin/tsc --noEmit → the one real source-level type error (missing useThrottle export) is resolved.

Assumptions

  • The 4 remaining tsc errors are Cannot find module 'bun:test' in test files only. These are pre-existing (confirmed by type-checking the base commit) and stem from bun-types not being wired into test-file type resolution. The task forbids modifying test files and these are unrelated to the source bugs, so they are left untouched.

- api.ts: import renamed useDebounce hook (was useThrottle), keep public useSearchDebounce alias
- Button: forward aria-label so icon-only buttons have an accessible name (WCAG 4.1.2)
- DataTable: use functional setState updater to fix stale-closure sort toggle
- formatDate: correct locale/format string to match expected output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant